<template>
  <div class="myClient">
    <TopromoteNav></TopromoteNav>
    <div class="writing_right">
      <div class="TitleList">
        <div class="TitleList_padding pointsdetails_title">
          <div class="TitleList_top">
            <div class="pointsdetails_title_left">
              <div class="TitleList_top_title"><span></span>我的客户</div>
            </div>
          </div>
        </div>
        <div class="pointsdetails_content">
          <div class="allflow">
            <div class="allflow_content">
              <div class="allflow_content_list">
                <div class="content_list_li">用户名id</div>
                <div class="content_list_li">用户名</div>
                <div class="content_list_li">累计充值</div>
                <div class="content_list_li">加入时间</div>
              </div>
            </div>
            <div class="allflow_content">
              <div v-if="infos.data.length">
                <div v-for="(item, index) in infos.data" :key="index" class="allflow_content_list">
                  <div class="content_list_li">{{ item.id }}</div>
                  <div class="content_list_li">{{ item.name }}</div>
                  <div class="content_list_li">{{ item.money }}元</div>
                  <div class="content_list_li">{{ item.create_time }}</div>
                </div>
              </div>
              <div v-else class="not_data not_data2" v-show="infos.data.length === 0">
                <div class="not_data_icon"><img src="@a/img/bg26.jpg"/></div>
                <div class="not_data_title">暂无数据</div>
              </div>
            </div>
            <div class="page">
              <el-pagination
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page="infos.current_page"
                  :page-sizes="per_pages"
                  :page-size="infos.per_page"
                  layout="total, sizes, prev, pager, next, jumper"
                  :total="infos.total">
              </el-pagination>
            </div>
          </div>
        </div>
      </div>
    </div>

  </div>
</template>


<script>
import TopromoteNav from "@c/common/topromoteNav/topromoteNav";

export default {
  name: "myClient",
  data() {
    return {
      infos: {
        data: [],
        per_page: 10,
        current_page: 1,
        last_page: 1,
        total: 0
      },
      per_pages: [10, 20, 30],
    };
  },
  components: {
    TopromoteNav
  },
  methods: {
    //分页
    handleSizeChange(val) {
      this.infos.per_page = val
      this.getList()
    },
    handleCurrentChange(val) {
      this.infos.current_page = val
      this.getList()

    },
    getList() {
      // loading 开始
      this.loading = true;

      let that = this;
      that.axios.get('/api/member/myCustomers', {
        params: {
          page: that.infos.current_page,
          list_rows: that.infos.per_page,
        }
      }).then(res => {
        // loading结束
        this.loading = false;

        that.infos = res.result;

      })
    },

  },
  created() {
    this.getList()
  }
}
</script>

<style>
@import "myClient.css";
</style>
